package com.wanxi.web.service.enterprise.impl;

import com.wanxi.enterprise.api.dto.EnterpriseUpdateInDTO;
import com.wanxi.enterprise.api.feign.EnterpriseFeignCilent;
import com.wanxi.enterprise.api.query.EnterpriseQuery;
import com.wanxi.enterprise.api.query.LocateApplyQuery;
import com.wanxi.enterprise.api.result.CommonResult;
import com.wanxi.enterprise.api.vo.EnterpriseAddInVo;
import com.wanxi.enterprise.api.vo.LocateApplyAddInVo;
import com.wanxi.enterprise.api.vo.LocateApplyAuditInVo;
import com.wanxi.enterprise.api.vo.NoLocateApplyInVO;
import com.wanxi.web.service.enterprise.EnterpriseWebService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;



@Service
public class EnterpriseWebServiceImpl implements EnterpriseWebService {


    @Resource
    private EnterpriseFeignCilent feignCilent;


    @Override
    public CommonResult findAll(EnterpriseQuery enterpriseQuery){
        return feignCilent.findAll(enterpriseQuery);
    }

    @Override
    public CommonResult findApplyAll(LocateApplyQuery enterpriseQuery){
        return feignCilent.findApplyAll(enterpriseQuery);
    }

    @Override
    public CommonResult addEnterprise(EnterpriseAddInVo enterpriseAddInVo) {
        return feignCilent.addEnterprise(enterpriseAddInVo);
    }

    @Override
    public CommonResult addApply(LocateApplyAddInVo locateApplyAddInVo) {
        return feignCilent.addApply(locateApplyAddInVo);
    }

    @Override
    public CommonResult findApplyDataById(Long id) {
        return feignCilent.findApplyDataById(id);
    }

    @Override
    public CommonResult updateEnterpriseById(EnterpriseUpdateInDTO enterpriseUpdateInDTO) {
        return feignCilent.updateEnterpriseById(enterpriseUpdateInDTO);
    }

    @Override
    public CommonResult updateApply(LocateApplyAuditInVo locateApplyAuditInVo) {
        return feignCilent.updateApply(locateApplyAuditInVo);
    }

    @Override
    public CommonResult noApply(NoLocateApplyInVO noLocateApplyInVO) {
        feignCilent.noApply(noLocateApplyInVO);
        feignCilent.updateLocateStatus(noLocateApplyInVO);
        return CommonResult.success("驳回成功");
    }

}
